package railRoad;

/**
 * Class that presents Station data
 * 
 * @author Rukin Oleg
 * 
 */
public class Station {

	private int station_id;
	private String stationName;
	private float altitude;
	private float longitude;

	public Station(String stationName, float altitude, float longitude) {
		this(-1, stationName, altitude, longitude);
	}

	public Station(int station_id, String stationName, float altitude,
			float longitude) {
		super();
		this.station_id = station_id;
		this.stationName = stationName;
		this.altitude = altitude;
		this.longitude = longitude;
	}

	public int getStation_id() {
		return station_id;
	}

	public void setStation_id(int station_id) {
		this.station_id = station_id;
	}

	/**
	 * Getter for StationName
	 * 
	 * @return StationName
	 */
	public String getStationName() {
		return stationName;
	}

	public void setStationName(String stationName) {
		this.stationName = stationName;
	}

	/**
	 * Getter for Altitude
	 * 
	 * @return Altitude
	 */
	public float getAltitude() {
		return altitude;
	}

	public void setAltitude(float altitude) {
		this.altitude = altitude;
	}

	/**
	 * Getter for Longitude
	 * 
	 * @return Longitude
	 */
	public float getLongitude() {
		return longitude;
	}

	public void setLongitude(float longitude) {
		this.longitude = longitude;
	}

	@Override
	public String toString() {
		return "Station:\t" + station_id + "  " + stationName + " (" + altitude
				+ ";" + longitude + ")\n";
	}

	@Override
	public boolean equals(Object obj) {

		if (obj instanceof Station) {
			final Station station = (Station) obj;
			if ((this.altitude == station.altitude)
					&& (this.longitude == station.longitude)
					&& (this.station_id == station.station_id)
					&& (this.stationName.equals(station.stationName)))
				return true;
		}

		return false;
	}
}
